package org.marsson.bNav;

import org.apache.log4j.PropertyConfigurator;

/**
 * Demo.java:   Allows player to pick locations and select targets
 * @author      William Dubel
 * @version     1.0    June 29, 2001
 */

class Demo extends Game implements Runnable
{
	
	protected PlayingField mainHandle;
	BattleShip battleship;
	
	Demo(BattleShip battleship)
	{
		super("Batalha Naval",battleship);
		new Thread(this, "Game Server").start();
		this.battleship=battleship;
		PropertyConfigurator.configure("src/main/resources/log4j.properties");  
		
	}
	

	public void run()
	{
		if (BattleShip.soundOn()) Sound.start.play();
		
		
		
		
		
		myField.placeShips();

		
					
		while (demoRunning)
		{
			thePoint = myField.getPoint();
			result = myField.getHit(thePoint);		//In real game this is sent to & recieved from opponent
			//if (result.getNavio()!=Ships.SPLASH) myField.setResult(thePoint, result);
			try	{	Thread.sleep(10);	}
			catch	(InterruptedException ie)	{	ie.printStackTrace();	}
		}
	}
}
